package jym.tan.movielibrary.factory;

import jym.tan.movielibrary.component.renderer.DateCellRenderer;
import jym.tan.movielibrary.component.renderer.StringCellRenderer;
import jym.tan.movielibrary.component.renderer.MovieSearchResultTableCellRenderer;

public class RendererFactory {

	private static DateCellRenderer dateCellRenderer;
	private static StringCellRenderer stringCellRenderer;
	private static MovieSearchResultTableCellRenderer movieSearchResultTableCellRenderer;
	
	public static synchronized DateCellRenderer getDateCellRenderer() {
		if(dateCellRenderer == null) {
			dateCellRenderer = new DateCellRenderer();
		}
		return dateCellRenderer;
	}

	public static synchronized StringCellRenderer getStringCellRenderer() {
		if(stringCellRenderer == null) {
			stringCellRenderer = new StringCellRenderer();
		}
		return stringCellRenderer;
	}

	public static synchronized MovieSearchResultTableCellRenderer getMovieSearchResultTableCellRenderer() {
		if(movieSearchResultTableCellRenderer == null) {
			movieSearchResultTableCellRenderer = new MovieSearchResultTableCellRenderer();
		}
		return movieSearchResultTableCellRenderer;
	}
}
